package com.jt.mapper;

import com.jt.pojo.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.util.HashMap;
import java.util.List;

@Mapper
public interface UserAnnoMapper {
    @Select("select * from demo_user" )
    List<User> findAll();

    @Select("select * from demo_user where id = #{id} ")
    List<User> findUserId(User user);

    @Insert("insert into demo_user value (#{id},#{name},#{age},#{sex})")
    void insertUser(User user);

    @Update("update demo_user set name=#{newName} where name = #{oldName}")
    void updateUser(HashMap<String, String> map);

    List<User> findCache1();
}
